package com.jeeplus.modules.web.service;

import com.jeeplus.core.service.CrudService;
import com.jeeplus.modules.web.entity.YjRoomCalls;
import com.jeeplus.modules.web.mapper.YjRoomCallsMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author liangbing
 * @version 1.0
 * @date 2021/3/24 14:50
 * @description xxx
 */
@Service
@Transactional(readOnly = true)
public class YjRoomCallsService extends CrudService<YjRoomCallsMapper, YjRoomCalls> {

    @Autowired
    private YjRoomCallsMapper yjRoomCallsMapper;

    public List<YjRoomCalls> getWaiterRoomCalls(YjRoomCalls yjRoomCalls){
        return yjRoomCallsMapper.getWaiterRoomCalls(yjRoomCalls);
    }

    /**
     * 响应呼叫
     * @param yjRoomCalls
     */
    @Transactional(readOnly = false)
    public void responseRoomCall(YjRoomCalls yjRoomCalls) {
        yjRoomCallsMapper.responseRoomCall(yjRoomCalls);
    }

    /**
     * 完成呼叫
     * @param yjRoomCalls
     */
    @Transactional(readOnly = false)
    public void completeRoomCall(YjRoomCalls yjRoomCalls) {
        yjRoomCallsMapper.completeRoomCall(yjRoomCalls);
    }
}
